Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

258
Vistas
Is it safe to "eval" the result of pythons (built-in) json.load?

I'm writing an application in Adobes ExtendScript (older version of Javascript) where I need to parse very large json files. To do this I'm using the json2 library as there is no built-in method.

The files can often be about 10mb in size and (mostly) contains lists/dicts with tens of thousands of numbers/strings. Parsing this in Python using json.load is almost instant, but in ExtendScript it takes around 25 minutes (!).

The only way I've found to speed up this is to "eval" the code directly (no parsing) to a Javascript object. This turns the process down to something very similar to Python. Obviously it doesn't feel great to eval the code as the json files can come from different sources.

One idea I've been playing with is to let Python "validate" the content of the file before calling eval. Something like this:

  • Call Python from Javascript and let Python parse the file using json.load. Return the result to Javascript as a string.
  • Call Javascripts eval on the result from Python.

Would this be considered safe? Or does this not clean the json enough to remove and security risks?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda